<?php
/*
 *pc端
 */
namespace app\comm\controller;
use app\comm\service\UserService;
use think\Controller;

class PcIndexController extends Controller {

public $userinfo;
	
	/**
	 * 自动加载
	 */
	public function __construct(){
		parent::__construct();
		if(is_mobile()){
			$this->redirect('index/index/index');	
		}
		if(method_exists($this, "__autoload_web")){
			$this->__autoload_web();
		}
		if(method_exists($this, "__autoindex")){
			$this->__autoindex();
		}
	}
	
	/**
	 * zidongjiazailei 
	 * @return [type] [description]
	 */
	public function __autoload_web(){
		if(session('_user_uid_')){
			$useri  =  (new UserService())->getuserinfobyuid(session('_user_uid_')['uid']);
			if($useri["sex"]==0){
				$useri["sex_cn"] ="保密";
			}
			if($useri["sex"]==1){
				$useri["sex_cn"] ="男";
			}
			if($useri["sex"]==2){
				$useri["sex_cn"] ="女";
			}
			$this ->userinfo = $useri;
		}
	}

	/**
	 * 上传文件，图片方法
	 * @return [type] [description]
	 */
	public function uploadfile($path,$post){

	}
}